package com.cz.video.website.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.cz.video.common.core.validate.AddGroup;
import com.cz.video.common.core.validate.EditGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.util.Date;

/**
 * <p>
 * 用户历史浏览记录
 * </p>
 *
 * @author 陈智
 * @since 2023-08-03
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Schema(description="用户历史浏览对象")
public class WebsiteHistory {

    @TableId(value = "id")
    @Null(groups = AddGroup.class)
    private Long id;

    @Schema(description = "源id")
    @NotNull(groups = {AddGroup.class, EditGroup.class})
    private Long videoId;

    @Schema(description = "用户id")
    private Long userId;

    @Schema(description = "上次看的位置")
    private Integer currentTime;

    @Schema(description = "创建时间")
    @Null(groups = {AddGroup.class})
    private Date createTime;

    @Schema(description = "更新时间")
    @Null(groups = {AddGroup.class})
    private Date updateTime;
}
